package com.commerceerp.system.mapper;

import com.commerceerp.system.api.winit.model.OutboundOrder;
import com.commerceerp.system.entity.OrderDetailVo;
import com.commerceerp.system.entity.OrderInfo;
import com.commerceerp.system.entity.OrderVo;
import com.commerceerp.system.entity.SkuVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

public interface OrderMapper extends Mapper{


    List<Map> getAllOrderInfo(@Param("userId")String userId,@Param("orderChannel")String orderChannel, @Param("storeName")String storeName,@Param("orderId")String orderId, @Param("addressCountry")String addressCountry,
                              @Param("orderStatus")String orderStatus, @Param("orderDownTimePX")Integer orderDownTimePX, @Param("orderSkuPX")Integer orderSkuPX,
                              @Param("orderMoneyPX")Integer orderMoneyPX,@Param("beginTime")String beginTime,@Param("endTime")String endTime);

    //检索订单id
    String getOrderIdId(@Param("orderId") String orderId);

    Integer updOrderStatus(@Param("orderId")String orderId,@Param("orderStatus")String orderStatus,@Param("orderUpdTime")String orderUpdTime);

    Map<String,Object> getOrderDetailInfo(String orderId);

    Integer  updOrderAddressInfo(OrderInfo orderInfo);

    //订单状态统计
    List<Map> orderCount(String userId);

    Integer saveLogisticInfoByOrderId(@Param("logisticId") String logisticId,@Param("logisticName")String logisticName,@Param("logisticPhone")String logisticPhone,@Param("logisticInfo")String logisticInfo,
                                      @Param("logisticRemark")String logisticRemark,@Param("logisticrderId")String logisticrderId,@Param("logisticCreateTime")String logisticCreateTime,@Param("logisticStatus")String logisticStatus);

    //插入订单明细
    void insertOrderDetail(@Param("detailVos") List<OrderDetailVo> detailVos);

    List<Map> getGoodInfosByOrderId(String id);

    Map<String,Object> getGoodInfoByOrderDetail(String id);

    List<Map> getAllGoodInfos();

    List<Map> getNumAndMoneyByFinishOrder(String beginTime);

    List<Map> getNumAndMoneyByCancelOrder(String beginTime);

    List<SkuVo> getOrderSku();

    void updOrderImg(@Param("sku") String sku,@Param("url") String url);

    //修改订单
    void updateOrderByOut(OutboundOrder outboundOrder);
}
